blob: df757cf024285a5e5fb01cd991a5a851a06e2f6d [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano2bb13102006-03-06 07:10:216<meta name="generator" content="AsciiDoc 7.0.2" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-show-branch(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-show-branch(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-show-branch -
Junio C Hamano01078922006-03-10 00:31:47269 Show branches and their commits
Junio C Hamano1a4e8412005-12-27 08:17:23270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamano38064d52006-01-15 10:13:49275<div class="verseblock">
Junio C Hamano30e1db12006-12-23 10:29:52276<div class="content"><em>git-show-branch</em> [--all] [--remotes] [--topo-order] [--current]
Junio C Hamano2bb13102006-03-06 07:10:21277 [--more=&lt;n&gt; | --list | --independent | --merge-base]
Junio C Hamanod793de52006-12-26 09:11:43278 [--no-name | --sha1-name] [--topics] [&lt;rev&gt; | &lt;glob&gt;]&#8230;
Junio C Hamano16cf1582007-02-05 07:21:48279<em>git-show-branch</em> (-g|--reflog)[=&lt;n&gt;[,&lt;base&gt;]] [--list] [&lt;ref&gt;]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23280</div>
281<h2>DESCRIPTION</h2>
282<div class="sectionbody">
283<p>Shows the commit ancestry graph starting from the commits named
284with &lt;rev&gt;s or &lt;globs&gt;s (or all refs under $GIT_DIR/refs/heads
285and/or $GIT_DIR/refs/tags) semi-visually.</p>
286<p>It cannot show more than 29 branches and commits at a time.</p>
Junio C Hamano38064d52006-01-15 10:13:49287<p>It uses <tt>showbranch.default</tt> multi-valued configuration items if
288no &lt;rev&gt; nor &lt;glob&gt; is given on the command line.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23289</div>
290<h2>OPTIONS</h2>
291<div class="sectionbody">
292<dl>
293<dt>
294&lt;rev&gt;
295</dt>
296<dd>
297<p>
298 Arbitrary extended SHA1 expression (see <tt>git-rev-parse</tt>)
299 that typically names a branch HEAD or a tag.
300</p>
301</dd>
302<dt>
303&lt;glob&gt;
304</dt>
305<dd>
306<p>
307 A glob pattern that matches branch or tag names under
308 $GIT_DIR/refs. For example, if you have many topic
309 branches under $GIT_DIR/refs/heads/topic, giving
310 <tt>topic/*</tt> would show all of them.
311</p>
312</dd>
313<dt>
Junio C Hamanoeb415992008-06-08 22:49:47314-r
315</dt>
316<dt>
317--remotes
Junio C Hamano1a4e8412005-12-27 08:17:23318</dt>
319<dd>
320<p>
Junio C Hamano30e1db12006-12-23 10:29:52321 Show the remote-tracking branches.
322</p>
323</dd>
324<dt>
Junio C Hamanoeb415992008-06-08 22:49:47325-a
326</dt>
327<dt>
328--all
Junio C Hamano30e1db12006-12-23 10:29:52329</dt>
330<dd>
331<p>
332 Show both remote-tracking branches and local branches.
Junio C Hamano1a4e8412005-12-27 08:17:23333</p>
334</dd>
335<dt>
Junio C Hamano38064d52006-01-15 10:13:49336--current
337</dt>
338<dd>
339<p>
340 With this option, the command includes the current
341 branch to the list of revs to be shown when it is not
342 given on the command line.
343</p>
344</dd>
345<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23346--topo-order
347</dt>
348<dd>
349<p>
350 By default, the branches and their commits are shown in
351 reverse chronological order. This option makes them
352 appear in topological order (i.e., descendant commits
353 are shown before their parents).
354</p>
355</dd>
356<dt>
Junio C Hamano872c5682006-07-07 06:05:40357--sparse
358</dt>
359<dd>
360<p>
361 By default, the output omits merges that are reachable
362 from only one tip being shown. This option makes them
363 visible.
364</p>
365</dd>
366<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23367--more=&lt;n&gt;
368</dt>
369<dd>
370<p>
371 Usually the command stops output upon showing the commit
372 that is the common ancestor of all the branches. This
373 flag tells the command to go &lt;n&gt; more common commits
374 beyond that. When &lt;n&gt; is negative, display only the
375 &lt;reference&gt;s given, without showing the commit ancestry
376 tree.
377</p>
378</dd>
379<dt>
380--list
381</dt>
382<dd>
383<p>
Junio C Hamano38064d52006-01-15 10:13:49384 Synonym to <tt>--more=-1</tt>
Junio C Hamano1a4e8412005-12-27 08:17:23385</p>
386</dd>
387<dt>
388--merge-base
389</dt>
390<dd>
391<p>
392 Instead of showing the commit list, just act like the
393 <em>git-merge-base -a</em> command, except that it can accept
394 more than two heads.
395</p>
396</dd>
397<dt>
398--independent
399</dt>
400<dd>
401<p>
402 Among the &lt;reference&gt;s given, display only the ones that
403 cannot be reached from any other &lt;reference&gt;.
404</p>
405</dd>
406<dt>
407--no-name
408</dt>
409<dd>
410<p>
411 Do not show naming strings for each commit.
412</p>
413</dd>
414<dt>
415--sha1-name
416</dt>
417<dd>
418<p>
419 Instead of naming the commits using the path to reach
420 them from heads (e.g. "master~2" to mean the grandparent
421 of "master"), name them with the unique prefix of their
422 object names.
423</p>
424</dd>
Junio C Hamano52401ef2006-12-19 00:54:38425<dt>
426--topics
427</dt>
428<dd>
429<p>
430 Shows only commits that are NOT on the first branch given.
431 This helps track topic branches by hiding any commit that
432 is already in the main line of development. When given
433 "git show-branch --topics master topic1 topic2", this
Junio C Hamano6926bef2007-06-16 09:54:05434 will show the revisions given by "git rev-list &#94;master
Junio C Hamano52401ef2006-12-19 00:54:38435 topic1 topic2"
436</p>
437</dd>
Junio C Hamanod793de52006-12-26 09:11:43438<dt>
Junio C Hamano16cf1582007-02-05 07:21:48439--reflog[=&lt;n&gt;[,&lt;base&gt;]] [&lt;ref&gt;]
Junio C Hamanod793de52006-12-26 09:11:43440</dt>
441<dd>
442<p>
Junio C Hamanodb450ba2007-01-21 08:57:14443 Shows &lt;n&gt; most recent ref-log entries for the given
444 ref. If &lt;base&gt; is given, &lt;n&gt; entries going back from
Junio C Hamanofa0d4cf2007-01-25 02:23:58445 that entry. &lt;base&gt; can be specified as count or date.
Junio C Hamano16cf1582007-02-05 07:21:48446 <tt>-g</tt> can be used as a short-hand for this option. When
447 no explicit &lt;ref&gt; parameter is given, it defaults to the
448 current branch (or <tt>HEAD</tt> if it is detached).
Junio C Hamanod793de52006-12-26 09:11:43449</p>
450</dd>
Junio C Hamano1a4e8412005-12-27 08:17:23451</dl>
452<p>Note that --more, --list, --independent and --merge-base options
453are mutually exclusive.</p>
454</div>
455<h2>OUTPUT</h2>
456<div class="sectionbody">
457<p>Given N &lt;references&gt;, the first N lines are the one-line
458description from their commit message. The branch head that is
Junio C Hamano38064d52006-01-15 10:13:49459pointed at by $GIT_DIR/HEAD is prefixed with an asterisk <tt>*</tt>
460character while other heads are prefixed with a <tt>!</tt> character.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23461<p>Following these N lines, one-line log for each commit is
462displayed, indented N places. If a commit is on the I-th
Junio C Hamano38064d52006-01-15 10:13:49463branch, the I-th indentation character shows a <tt>+</tt> sign;
464otherwise it shows a space. Merge commits are denoted by
465a <tt>-</tt> sign. Each commit shows a short name that
Junio C Hamano235a91e2006-01-07 01:13:58466can be used as an extended SHA1 to name that commit.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23467<p>The following example shows three branches, "master", "fixes"
468and "mhf":</p>
469<div class="listingblock">
470<div class="content">
471<pre><tt>$ git show-branch master fixes mhf
Junio C Hamano38064d52006-01-15 10:13:49472* [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23473 ! [fixes] Introduce "reset type" flag to "git reset"
474 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
475---
476 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
477 + [mhf~1] Use git-octopus when pulling more than one heads.
478 + [fixes] Introduce "reset type" flag to "git reset"
479 + [mhf~2] "git fetch --force".
480 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
481 + [mhf~4] Make "git pull" and "git fetch" default to origin
482 + [mhf~5] Infamous 'octopus merge'
483 + [mhf~6] Retire git-parse-remote.
484 + [mhf~7] Multi-head fetch.
485 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
Junio C Hamano38064d52006-01-15 10:13:49486*++ [master] Add 'git show-branch'.</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23487</div></div>
488<p>These three branches all forked from a common commit, [master],
489whose commit message is "Add <em>git show-branch</em>. "fixes" branch
490adds one commit <em>Introduce "reset type"</em>. "mhf" branch has many
Junio C Hamano38064d52006-01-15 10:13:49491other commits. The current branch is "master".</p>
492</div>
493<h2>EXAMPLE</h2>
494<div class="sectionbody">
495<p>If you keep your primary branches immediately under
496<tt>$GIT_DIR/refs/heads</tt>, and topic branches in subdirectories of
497it, having the following in the configuration file may help:</p>
498<div class="listingblock">
499<div class="content">
500<pre><tt>[showbranch]
501 default = --topo-order
502 default = heads/*
503</tt></pre>
504</div></div>
Junio C Hamano2b135272006-03-18 07:45:42505<p>With this, <tt>git show-branch</tt> without extra parameters would show
Junio C Hamano38064d52006-01-15 10:13:49506only the primary branches. In addition, if you happen to be on
507your topic branch, it is shown as well.</p>
Junio C Hamanodb450ba2007-01-21 08:57:14508<div class="listingblock">
509<div class="content">
510<pre><tt>$ git show-branch --reflog='10,1 hour ago' --list master</tt></pre>
511</div></div>
512<p>shows 10 reflog entries going back from the tip as of 1 hour ago.
513Without <tt>--list</tt>, the output also shows how these tips are
514topologically related with each other.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23515</div>
516<h2>Author</h2>
517<div class="sectionbody">
518<p>Written by Junio C Hamano &lt;junkio@cox.net&gt;</p>
519</div>
520<h2>Documentation</h2>
521<div class="sectionbody">
522<p>Documentation by Junio C Hamano.</p>
523</div>
524<h2>GIT</h2>
525<div class="sectionbody">
Junio C Hamanof7c042d2008-06-06 22:50:53526<p>Part of the <a href="git.html">git(1)</a> suite</p>
Junio C Hamano1a4e8412005-12-27 08:17:23527</div>
528<div id="footer">
529<div id="footer-text">
Junio C Hamanoeb415992008-06-08 22:49:47530Last updated 08-Jun-2008 22:47:01 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23531</div>
532</div>
533</body>
534</html>